package multi.label.learning;

import mulan.classifier.lazy.MLkNN;
import mulan.classifier.meta.RAkEL;
import mulan.classifier.transformation.LabelPowerset;
import mulan.data.MultiLabelInstances;
import mulan.evaluation.Evaluator;
import mulan.evaluation.MultipleEvaluation;
import weka.classifiers.trees.J48;

/**
 * Created by Stellar_Lee on 2016/11/12.
 */
public class MulanExp1 {
    public static String basePath="D:\\multi-label-data\\mulan-test-data\\";
    public static int numFolds=10;
    public static void main(String[] args)throws Exception{
        MultiLabelInstances dataset=new MultiLabelInstances(basePath+"emotions.arff",basePath+"emotions.xml");
        RAkEL learner1=new RAkEL(new LabelPowerset(new J48()));
        MLkNN learner2=new MLkNN();
        Evaluator evaluator=new Evaluator();
        MultipleEvaluation results;
        results=evaluator.crossValidate(learner1,dataset,numFolds);
        System.out.println(results.toString());
        results=evaluator.crossValidate(learner2,dataset,numFolds);
        System.out.println(results.toString());
    }
}